package com.xlx.openLink.entity.device;

import com.xlx.openLink.entity.snmpenity.*;
import com.xlx.openLink.snmp.base.SNMPTarget;


import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;

/**
 * @author seven
 * @create 2019-06-17 10:12
 **/
public class DeviceInfo implements Serializable {
    private String deviceIP = "";
    private String deviceMAC = "";
    private String deviceName = "";
    private String deviceProtocol = "";
    private String deviceDesc = "";
    private String deviceSysOID = "";
    private SNMPTarget snmpTarget = null;
    private DeviceTypeInfo deviceType;
    private List<MibIPAddrEntry> ipaddressList;
    private List<MibIPRouterEntry> routerTableList;
    private List<MibIfEntry> ifTableList;
    private List<Dot1dTpFdbEntry> dTpFdbTableList;
    private List<Dot1dBasePortEntry> basePortList;
    private List<MibMacIP> mibMacIPList;
    private List<String> deviceMacList;
    private List<PortInfo> portInfoList;
    public static final String DeviceProtocolSNMP = "SNMP";
    public static final String DeviceProtocolPing = "Ping";

    public DeviceInfo() {
        this.deviceType = DeviceTypeInfo.UnkownType;
        this.ipaddressList = new Vector();
        this.routerTableList = new Vector();
        this.ifTableList = new Vector();
        this.dTpFdbTableList = new Vector();
        this.basePortList = new Vector();
        this.mibMacIPList = new Vector();
        this.deviceMacList = new Vector();
        this.portInfoList = new Vector();
    }

    public String toString() {
        return "IP地址 :" + this.deviceIP + "\n" + ",设备名称 : " + this.deviceName + "\n" + ",设备类型 : " + this.deviceType + "\n" +
                "设备描述:" + this.deviceDesc + "\n" + "MAC" + this.deviceMAC;
    }

    public void print() {
        System.out.println(
                "IP地址 :" + this.deviceIP + "\n" + "设备名称 : " + this.deviceName + "\n" + "设备类型 : " + this.deviceType + "\n" +
                        "设备描述:" + this.deviceDesc + "\n" + "MAC地址:" + this.deviceMAC+ "\n"+ "\n");
    }

    public String getDeviceIDCode() {
        String var1 = "";

        MibIfEntry var2;
        for (Iterator var3 = this.ifTableList.iterator(); var3.hasNext(); var1 = var1 + var2.getIfPhysAddress()) {
            var2 = (MibIfEntry) var3.next();
        }

        return var1;
    }

    public boolean equals(Object var1) {
        if (var1 instanceof DeviceInfo) {
            DeviceInfo var2 = (DeviceInfo) var1;
            if (this.getDeviceIP().equals(var2.getDeviceIP())) {
                return true;
            }

            if (var2.getDeviceMAC() != null && !var2.getDeviceMAC().equals("") && !var2.getDeviceMAC().equals("00:00:00:00:00:00") && var2.getDeviceMAC().equalsIgnoreCase(this.getDeviceMAC())) {
                return true;
            }

            if (!this.getDeviceIDCode().equals("") && this.getDeviceIDCode().equals(var2.getDeviceIDCode())) {
                // System.out.println(Messages.getString("DeviceInfo.15") + this + ";" + var1);
                return true;
            }
        }

        return false;
    }

    public void setDeviceSysOID(String var1) {
        this.deviceSysOID = var1;
    }

    public String getDeviceSysOID() {
        return this.deviceSysOID;
    }

    public String getDeviceIP() {
        return this.deviceIP;
    }

    public void setDeviceIP(String var1) {
        this.deviceIP = var1;
    }

    public List<String> getDeviceMacList() {
        return this.deviceMacList;
    }

    public void setDeviceMacList(List<String> var1) {
        this.deviceMacList = var1;
    }

    public String getDeviceMAC() {
        return this.deviceMAC;
    }

    public void setDeviceMAC(String var1) {
        this.deviceMAC = var1;
    }

    public String getDeviceName() {
        return this.deviceName;
    }

    public void setDeviceName(String var1) {
        this.deviceName = var1;
    }

    public String getDeviceDesc() {
        return this.deviceDesc;
    }

    public void setDeviceDesc(String var1) {
        this.deviceDesc = var1;
    }

    public SNMPTarget getSnmpTarget() {
        return this.snmpTarget;
    }

    public void setSnmpTarget(SNMPTarget var1) {
        this.snmpTarget = var1;
    }

    public void setDeviceType(DeviceTypeInfo var1) {
        this.deviceType = var1;
    }

    public DeviceTypeInfo getDeviceType() {
        return this.deviceType;
    }

    public void setDeviceProtocol(String var1) {
        this.deviceProtocol = var1;
    }

    public String getDeviceProtocol() {
        return this.deviceProtocol;
    }

    public void setIfTableList(List<MibIfEntry> var1) {
        this.ifTableList = var1;
    }

    public List<MibIfEntry> getIfTableList() {
        return this.ifTableList;
    }

    public List<MibMacIP> getMibMacIPList() {
        return this.mibMacIPList;
    }

    public void setMibMacIPList(List<MibMacIP> var1) {
        this.mibMacIPList = var1;
    }

    public List<PortInfo> getPortInfoList() {
        return this.portInfoList;
    }

    public void setPortInfoList(List<PortInfo> var1) {
        this.portInfoList = var1;
    }

    public List<Dot1dTpFdbEntry> getdTpFdbTableList() {
        return this.dTpFdbTableList;
    }

    public void setdTpFdbTableList(List<Dot1dTpFdbEntry> var1) {
        this.dTpFdbTableList = var1;
    }

    public List<MibIPAddrEntry> getIpaddressList() {
        return this.ipaddressList;
    }

    public void setIpaddressList(List<MibIPAddrEntry> var1) {
        this.ipaddressList = var1;
    }

    public List<MibIPRouterEntry> getRouterTableList() {
        return this.routerTableList;
    }

    public void setRouterTableList(List<MibIPRouterEntry> var1) {
        this.routerTableList = var1;
    }

    public List<Dot1dBasePortEntry> getBasePortList() {
        return this.basePortList;
    }

    public void setBasePortList(List<Dot1dBasePortEntry> var1) {
        this.basePortList = var1;
    }
}
